<?php

namespace app\admin\model\yeemanage;

use think\Model;


class Yeemicro extends Model
{

    

    

    // 表名
    protected $name = 'yeemicro';
    
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = 'integer';

    // 定义时间戳字段名
    protected $createTime = 'createtime';
    protected $updateTime = 'updatetime';
    protected $deleteTime = false;

    // 追加属性
    protected $append = [
        'businessRole_text',
        'legalLicenceType_text',
        'applicationStatus_text'
    ];
    

    
    public function getBusinessroleList()
    {
        return ['SHARE_MERCHANT' => __('分账接收方'), 'PLATFORM_MERCHANT' => __('平台商'), 'ORDINARY_MERCHANT' => __('标准商户'), 'SETTLED_MERCHANT' => __('入驻商户')];
    }

    public function getLegallicencetypeList()
    {
        return ['OFFICERS' => __('Officers'), 'SOLDIER' => __('Soldier'), 'TAIWAN' => __('Taiwan'), 'HM_VISITORPASS' => __('Hm_visitorpass'), 'PASSPORT' => __('Passport'), 'ID_CARD' => __('Id_card')];
    }

    public function getApplicationstatusList()
    {
        return ['COMPLETED' => __('Completed'), 'BUSINESS_OPENING' => __('Business_opening'), 'AGREEMENT_SIGNING' => __('Agreement_signing'), 'REVIEW_BACK' => __('Review_back'), 'REVIEWING' => __('Reviewing')];
    }
public function getBankaccounttypeList()
    {
        return ['DEBIT_CARD' => __('借记卡'), 'PASSBOOK' => __('存折')];
    }

    public function getBusinessroleTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['businessRole']) ? $data['businessRole'] : '');
        $list = $this->getBusinessroleList();
        return isset($list[$value]) ? $list[$value] : '';
    }


    public function getLegallicencetypeTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['legalLicenceType']) ? $data['legalLicenceType'] : '');
        $list = $this->getLegallicencetypeList();
        return isset($list[$value]) ? $list[$value] : '';
    }


    public function getApplicationstatusTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['applicationStatus']) ? $data['applicationStatus'] : '');
        $list = $this->getApplicationstatusList();
        return isset($list[$value]) ? $list[$value] : '';
    }




}
